@extends('frontend::layout')

@section('title', '评测列表')

@section('content')
    <div class="card border-no">
        <div class="card-body">
            <div class="col-lg-12 col-sm-12 col-xs-12" id="chart"></div>
            <div class="row">
                <div class="clearfix"></div>
                <div class="col-md-12 col-sm-12 col-xs-12 pull-right">
                    <p>
                        <a href="{{ route('wechat.assessment.add', ['child_id'=>$child->id]) }}" class="btn btn-primary btn-sm">添加评测</a>
                    </p>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th scope="col">#</th>
                        <th scope="col">{{ __('评测工具/量表') }}</th>
                        <th scope="col">{{ __('生理年龄') }}</th>
                        <th scope="col">{{ __('发展年龄') }}</th>
                        <th scope="col">{{ __('评测时间') }}</th>
                        <th scope="col">{{ __('评测阶段') }}</th>
                    </tr>
                    </thead>
                    <tbody>
                    @if(isset($list))
                        @foreach($list as $idx => $item)
                            <tr>
                                <th scope="row">{{ $idx + 1 }}</th>
                                <td>{{ !empty($item->tool) ? $item->tool->name : $item->tool_id }}</td>
                                <td>{{ $item->age }}</td>
                                <td>{{ $item->agedevelop }}</td>
                                <td>{{ $item->assess_time }}</td>
                                <td>{{ $stage[$item->stage] }}</td>
                                <td>

                                        <a href="{{ route('wechat.assessment.view', ['id' => $item->id]) }}" class="text-primary" title="{{ __('View') }}">&nbsp;&nbsp;<i class="fa fa-eye"></i></a>

                                        <a href="{{ route('wechat.assessment.edit', ['id' => $item->id]) }}" class="text-info" title="{{ __('Edit') }}">&nbsp;&nbsp;<i class="fa fa-pencil"></i></a>

                                        <a href="{{ route('wechat.assessment.delete', ['id' => $item->id]) }}" class="text-danger confirm-delete" title="{{ __('Delete') }}">&nbsp;&nbsp;<i class="fa fa-trash-o"></i></a>

                                </td>
                            </tr>
                        @endforeach
                    @endif
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="clearfix"></div>
                <div class="col-md-12 col-sm-12 col-xs-12 pull-right">

                </div>
            </div>
        </div>
    </div>
@stop